[GPU] Detach a GPU from an instance
curl --request POST \
--url https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"size_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"os_name": "<string>",
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach"
payload = {
"name": "<string>",
"size_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"os_name": "<string>",
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
size_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
image_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
os_name: '<string>',
vpc_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tags: ['<string>']
})
};
fetch('https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'size_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'image_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'os_name' => '<string>',
'vpc_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"os_name\": \"<string>\",\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"os_name\": \"<string>\",\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"os_name\": \"<string>\",\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyCompute
[GPU] Detach a GPU from an instance
Detach a GPU from the instance and finalize billing for the session. The instance is stopped and restarted as part of the operation. The operation is asynchronous; monitor the returned task for completion.
POST
/
v1
/
organizations
/
{organization_id}
/
projects
/
{project_id}
/
compute
/
instances
/
{id}
/
gpus
/
detach
[GPU] Detach a GPU from an instance
curl --request POST \
--url https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"size_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"os_name": "<string>",
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach"
payload = {
"name": "<string>",
"size_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"os_name": "<string>",
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
size_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
image_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
os_name: '<string>',
vpc_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tags: ['<string>']
})
};
fetch('https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'size_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'image_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'os_name' => '<string>',
'vpc_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"os_name\": \"<string>\",\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"os_name\": \"<string>\",\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onetsolutions.net/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/detach")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"os_name\": \"<string>\",\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Use Authorization: Bearer <token> header. Token can be a JWT token or an API key (format: sk-onetsolutions-...).
Path Parameters
A UUID string identifying this Instance.
Unique identifier of the compute instance.
Unique identifier of the organization that owns the resource.
Unique identifier of the project containing the resource.
Body
application/json
Instance hostname
Maximum string length:
255Operating system name
Maximum string length:
100free- Freeone_time- One Timehourly- Hourlymonthly- Monthlyquarterly- Quarterlysemi_annually- Semi-Annuallyannually- Annuallybiennially- Bienniallytriennially- Triennially
Available options:
free, one_time, hourly, monthly, quarterly, semi_annually, annually, biennially, triennially Custom tags
Maximum string length:
50Response
GPU detachment initiated successfully
[GPU] List GPUs available on the instance node
Previous
[GPU] List past GPU sessions for an instance
Next
⌘I

